<!--
 * @Author: gy
 * @Date: 2020-07-02 10:26:18
 * @LastEditors: gy
 * @LastEditTime: 2020-07-10 16:34:56
-->
<!-- 
ebom_code	是	string	EBOM编号
ebom_name	否	string	EBOM名称
ebom_desc	否	string	EBOM描述
ebom_designer	否	string	设计EBOM人
ebom_designer_phone	否	string	设计人联系电话
fk_ebom_file	否	string	设计文档外键
fk_pro_equipment_id	是	string	设备外键
status	是	string	状态 (0 已创建 1 已比对 2 已下发)
remark	否	string	备注
-->
<!--  -->
<template>
    <div>
        <el-form ref="form" :model="form" :rules="rules">
            <el-form-item label="EBOM编号" prop="ebom_code">
                <el-input v-model="form.ebom_code"></el-input>
            </el-form-item>
            <el-form-item label="EBOM名称" prop="ebom_name">
                <el-input v-model="form.ebom_name"></el-input>
            </el-form-item>
            <el-form-item label="EBOM描述" prop="ebom_desc">
                <el-input v-model="form.ebom_desc"></el-input>
            </el-form-item>
            <el-form-item label="设计EBOM人" prop="ebom_designer">
                <el-input v-model="form.ebom_designer"></el-input>
            </el-form-item>
            <el-form-item label="设计人联系电话" prop="ebom_designer_phone">
                <el-input v-model="form.ebom_designer_phone"></el-input>
            </el-form-item>
            <el-form-item label="设计文档外键" prop="fk_ebom_file">
                <el-input v-model="form.fk_ebom_file"></el-input>
            </el-form-item>
            <el-form-item label="设备外键" prop="fk_pro_equipment_id">
                <el-select v-model="form.fk_pro_equipment_id" placeholder="">
                  <el-option v-for="item in machineList" :key="item.pk_id" :label="item.pro_equipment_name" :value="item.pk_id"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="状态" prop="status">
                <el-select v-model="form.status" placeholder="">
                    <el-option label="请选择" value=""></el-option>
                    <el-option label="已创建" value="0"></el-option>
                    <el-option label="已对比" value="1"></el-option>
                    <el-option label="已下发" value="2"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="备注">
                <el-input type="textarea" v-model="form.remark"></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
import {getMachineList} from '@/api/api'
export default {
    props: {},
    data() {
        return {
            machineList:[],
            form: {
                ebom_code: "",
                ebom_name: "",
                ebom_desc: "",
                ebom_designer: "",
                ebom_designer_phone: "",
                fk_ebom_file: "",
                fk_pro_equipment_id: "",
                material_atype_desc: "",
                remark: "",
                status:''
            },
            rules: {
                ebom_code: [
                    {
                        required: true,
                        message: "请输入EBOM编号",
                        trigger: "blur"
                    }
                ],
                fk_pro_equipment_id: [
                    {
                        required: true,
                        message: "请输入设备外键",
                        trigger: "blur"
                    }
                ],
                status: [
                    {
                        required: true,
                        message: "请选择状态",
                        trigger: "change"
                    }
                ]
            },
            checkRepeatParam: {
                url: "/material/api/MesEBOM/CheckMesEBOMCodeUnique",
                param: "ebom_code",
                method: "get"
            }
        };
    },

    components: {},

    methods: {},
    mounted(){
        //获取设备list
        getMachineList().then(res=>{
            if(res.code == 0){
                this.machineList = res.rows
            }
        })
    }
};
</script>
<style lang="scss" scoped></style>
